package org.example.authservice.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.PastOrPresent;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author lj20050120
 */
@Data
public class Task {
    private Integer taskId;

    /**
     * NotBlank  验证字符串不能为空，@Size 验证字符串长度，@PastOrPresent 验证日期不能在未来
     */
    @NotBlank(message = "课程名不能为空")
    @Size(min = 3, max = 20, message = "课程名长度必须在3到20个字符之间")
    private String taskName;

    @NotBlank(message = "课程介绍不能为空")
    @Size(max = 1000, message = "课程介绍不能超过1000个字符")
    private String taskDescription;

    @NotBlank(message = "课程开始日期不能为空")
    @PastOrPresent(message = "截止日期不能小于当天")
    private LocalDateTime dueDate;

    @PastOrPresent(message = "创建时间不能在未来")
    private LocalDateTime createDat;

    @PastOrPresent(message = "更新时间不能在未来")
    private LocalDateTime updateDat;

    private Integer teacherId;

    @TableField(exist = false)
    private String teacherName;
}